/**
 * Created by Jackie on 2017/2/21.
 */

import Vue from 'vue'


// http://iot2.midea.com.cn/front/index.html#/
// const SERVER = 'http://iot2.midea.com.cn';
const SERVER = 'http://localhost:8002';
// const SERVER = 'https://mdzncf.qyine.com';
/**
 *
 * 测试数据
 *
 */
export function MockService() {
    return Vue.resource('/static/json/mock.json')
}
/**
 *
 *
 * 模拟登陆
 */
export function TestLoginService() {
    // return Vue.resource(`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf1f47196e8312587&redirect_uri=http%3A%2F%2Fiot2.midea.com.cn%2Fapi%2Fweixin%2Flogin&response_type=code&scope=snsapi_base&state=953843153#wechat_redirect`)
    return Vue.resource(`${SERVER}/api/weixin/login/testapi`)
}
/**
 *
 * 订单详情
 */
export function getOrderInfoService() {
    return Vue.resource(`${SERVER}/api/order/orderDetail{/orderId}`)
}
/**
 *
 * 历史订单
 */
export function getOrderHistoryService() {
    return Vue.resource(`${SERVER}/api/order/orderHistory{/pageNo}{/pageSize}`)
}
/**
 *
 * 门店菜单主分类
 *
 */
export function MainMenuService() {
    return Vue.resource(`${SERVER}/api/store/showStoreMenus`)
}
/**
 *
 * 门店菜单
 *
 */
export function showMenusService() {
    return Vue.resource(`${SERVER}/api/store/showMenus`)
}
/**
 *
 * 购物车新增商品
 *
 */
export function shoppingCartService() {
    return Vue.resource(`${SERVER}/api/order/shoppingCartAdd`)
}
/**
 *
 * 清空购物车
 *
 */
export function clearCartService() {
    return Vue.resource(`${SERVER}/api/order/shoppingCartClear`)
}
/**
 *
 * 门店菜单子菜单
 *
 */
export function showStoreMenusDetail() {
    return Vue.resource(`${SERVER}/api/store/showStoreMenusDetail`)
    // return Vue.resource('/static/json/sonmenu.json')
}
/**
 *
 *  门店菜单_选择门店
 *
 */
export function showStoreList() {
    return Vue.resource(`${SERVER}/api/store/showStoreList`)
}
/**
 *  生成订单
 */
export function orderCreate() {
    return Vue.resource(`${SERVER}/api/order/createOrder`)
}
/**
 *   获取微信配置
 *
 */
export function GetWeixinConfig() {
    return Vue.resource(`${SERVER}/api/weixin/js/config{/location}`)
}
/**
 *   获取确认订单
 *
 */
export function PostComfirmOrderService() {
    return Vue.resource(`${SERVER}/api/order/wxOrderPay{/orderId}{/flag}`)
}
/**
 *   获取确认订单
 *
 */
export function WXPayService() {
    return Vue.resource(`${SERVER}/WXPay/preorder`)
}
/**
 *   菜品详情
 *
 */
export function dishesDetailService() {
    return Vue.resource(`${SERVER}/api/cdDishes/dishesDetail`)
}
/**
 *   是否为为净菜包
 */
export function diningWayService() {
    return Vue.resource(`${SERVER}/api/store/diningWay`)
}
/**
 *  获取附近门店
 */
export function nearStoreService() {
    return Vue.resource(`${SERVER}/api/store/nearStore`)
}
/**
 *  切换城市
 */
export function changeCityService() {
    return Vue.resource(`${SERVER}/api/store/changeCity`)
}
/**
 * 取餐码
 */
export function getTakeFoodCodeService() {
    return Vue.resource(`${SERVER}/api/order/getTakeFoodCode`)
}
/**
 * 查询门店营业时间
 */
export function openTimeService() {
    return Vue.resource(`${SERVER}/api/store/openTime`)
}
/**
 * 创建评价
 */
export function createEvaluateService() {
    return Vue.resource(`${SERVER}/api/evaluate/createEvaluate`)
}
/**
 * 查看评价
 */
export function showEvaluateService() {
    return Vue.resource(`${SERVER}/api/evaluate/showEvaluate`)
}
/**
 * 门店评价
 */
export function evaluationsService() {
    return Vue.resource(`${SERVER}/api/evaluate/evaluations`)
}
/**
 * 评价列表
 */
export function commentlistService() {
    return Vue.resource(`${SERVER}/api/evaluate/list`)
}
/**
 * 判断是否为第一次登陆
 */
export function isFirstInService() {
    return Vue.resource(`${SERVER}/api/store/isFirstIn`)
}
/**
 * 判断是否绑定手机
 */
export function isBindingService() {
    return Vue.resource(`${SERVER}/api/register/isBinding`)
}
/**
 * 获取验证码
 */
export function registsendService() {
    return Vue.resource(`${SERVER}/api/register/registsend`)
}
/**
 * 验证验证码
 */
export function registVerifyService() {
    return Vue.resource(`${SERVER}/api/register/registVerify`)
}

/**
 * 取餐码
 */
export function getTakeFoodCode() {
    return Vue.resource(`${SERVER}/api/order/getTakeFoodCode`)
}

/**
 * 到店通知
 */
export function arriveNotify(){
    return Vue.resource(`${SERVER}/api/order/arriveNotify`)
} 


